home *** CD-ROM | disk | FTP | other *** search
/ Collection of Tools & Utilities / Collection of Tools and Utilities.iso / borland / jnfb88.zip / PALPRO.ZIP / HYPO.C < prev    next >
Text File  |  1987-10-07  |  389b  |  25 lines

  1. #include <stdio.h>
  2. #include <math.h> 
  3.  
  4. float Hypotenuse(x,y) 
  5. int x,y; 
  6.         float w,z; 
  7.  
  8.         w = x*x; 
  9.         z = y*y; 
  10.         return sqrt(w+z); 
  11.  
  12. main() 
  13.         int x,y; 
  14.  
  15.         x = 4; 
  16.         y = 5; 
  17.  
  18.         printf("If a right triangle has sides %d and %d,\n",x,y);
  19.         printf("then its hypotenuse is %f.\n",Hypotenuse(x,y));
  20. }
  21.  
  22.